#include <HardwareSerial.h>
#include "DEV_Config.h"
#include <U8g2lib.h>
#include "L76X.h"

#define U8G2_SCL 5
#define U8G2_SDA 4

U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2( U8G2_R0, /* clock=*/ U8G2_SCL, /* data=*/ U8G2_SDA, /* reset=*/ U8X8_PIN_NONE );

GNRMC GPS1;
Coordinates B_GPS;
char buff_G[800]={0};

void displayWelcome(const char * str) {
  u8g2.clearBuffer();
  /* 将字符串显示在屏幕中央 */
  u8g2.drawUTF8( u8g2.getDisplayWidth() / 2 - u8g2.getUTF8Width( str ) / 2, u8g2.getDisplayHeight() / 2 + u8g2.getMaxCharHeight() / 2, str );
  u8g2.sendBuffer();
}

void setup()
{
 Serial.begin(9600);
 u8g2.setFont( u8g2_font_wqy12_t_gb2312 );
  u8g2.begin();
  u8g2.enableUTF8Print();
DEV_Set_Baudrate(115200);
DEV_Delay_ms(500);
}

void loop() // run over and over
{
  //DEV_Uart_ReceiveString(buff_G,800);
 // printf(buff_G);
  displayWelcome(L76X_Gat_GNRMC());
 
}

